import Vue from 'vue'
const user = {
    // 获取列表
    userList: function userList(ip, postdata) {
        var ipStr = ip + "/" + postdata.pageSize + "/" + postdata.number
        return Vue.http.post(ipStr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 注册
    userOne: function userOne(ip, postdata) {
        // console.log(postdata, ip)
        var ipStr = ip + "/" + postdata.id
        return Vue.http.get(ipStr, {}).then(response => {
            // console.log('end')
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    }
}

export default user